export const gptSoVitsApi = () => {
  const generate = (text: string) => {
    const { chatSettings } = storeToRefs(chatSettingStore());
    const { port } = storeToRefs(gptSoVitsStore());
    const GptSoVitsSet = chatSettings.value["Gpt-SoVits"].template;
    const { bindAddress } = GptSoVitsSet;
    return useDefaultRequest.post<Blob, any>(
      `http://${bindAddress.value}:${port.value}`,
      {
        text,
        text_language: "zh",
      },
      {
        responseType: "blob",
      }
    );
  };
  return { generate };
};
